/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('xgippop', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ChangeApplicationInfoRequest {
  aliUid?: long(name='AliUid'),
  appId?: string(name='AppId'),
  appName?: string(name='AppName'),
  appTypeList?: string(name='AppTypeList'),
  appingList?: string(name='AppingList'),
  itemCode?: string(name='ItemCode'),
}

model ChangeApplicationInfoResponseBody = {
  appId?: string(name='AppId'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeApplicationInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ChangeApplicationInfoResponseBody(name='body'),
}

async function changeApplicationInfoWithOptions(request: ChangeApplicationInfoRequest, runtime: Util.RuntimeOptions): ChangeApplicationInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aliUid)) {
    body['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appTypeList)) {
    body['AppTypeList'] = request.appTypeList;
  }
  if (!Util.isUnset(request.appingList)) {
    body['AppingList'] = request.appingList;
  }
  if (!Util.isUnset(request.itemCode)) {
    body['ItemCode'] = request.itemCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeApplicationInfo',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function changeApplicationInfo(request: ChangeApplicationInfoRequest): ChangeApplicationInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeApplicationInfoWithOptions(request, runtime);
}

model ChargeFlowRequest {
  channelCode?: string(name='ChannelCode'),
  instanceId?: string(name='InstanceId'),
  itemCode?: string(name='ItemCode'),
  mobile?: string(name='Mobile'),
  orderTime?: string(name='OrderTime'),
  outBizNo?: string(name='OutBizNo'),
  UId?: long(name='UId'),
}

model ChargeFlowResponseBody = {
  code?: string(name='Code'),
  data?: {
    bizCode?: string(name='BizCode'),
    customerFlowOrderId?: string(name='CustomerFlowOrderId'),
    customerFlowRequestId?: string(name='CustomerFlowRequestId'),
    status?: string(name='Status'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model ChargeFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ChargeFlowResponseBody(name='body'),
}

async function chargeFlowWithOptions(request: ChargeFlowRequest, runtime: Util.RuntimeOptions): ChargeFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.channelCode)) {
    query['ChannelCode'] = request.channelCode;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.itemCode)) {
    query['ItemCode'] = request.itemCode;
  }
  if (!Util.isUnset(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!Util.isUnset(request.orderTime)) {
    query['OrderTime'] = request.orderTime;
  }
  if (!Util.isUnset(request.outBizNo)) {
    query['OutBizNo'] = request.outBizNo;
  }
  if (!Util.isUnset(request.UId)) {
    query['UId'] = request.UId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChargeFlow',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function chargeFlow(request: ChargeFlowRequest): ChargeFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return chargeFlowWithOptions(request, runtime);
}

model CreateApplicationInfoRequest {
  aliUid?: long(name='AliUid'),
  appName?: string(name='AppName'),
  appTypeList?: [ string ](name='AppTypeList'),
  appingList?: [ 
    {
      extId?: long(name='ExtId'),
      flowIp?: [ string ](name='FlowIp'),
      flowUrl?: [ string ](name='FlowUrl'),
      originalIpList?: [ string ](name='OriginalIpList'),
      originalUrlList?: [ string ](name='OriginalUrlList'),
    }
  ](name='AppingList'),
  itemCode?: string(name='ItemCode'),
}

model CreateApplicationInfoResponseBody = {
  appId?: string(name='AppId'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateApplicationInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateApplicationInfoResponseBody(name='body'),
}

async function createApplicationInfoWithOptions(request: CreateApplicationInfoRequest, runtime: Util.RuntimeOptions): CreateApplicationInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aliUid)) {
    body['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appTypeList)) {
    body['AppTypeList'] = request.appTypeList;
  }
  if (!Util.isUnset(request.appingList)) {
    body['AppingList'] = request.appingList;
  }
  if (!Util.isUnset(request.itemCode)) {
    body['ItemCode'] = request.itemCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateApplicationInfo',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApplicationInfo(request: CreateApplicationInfoRequest): CreateApplicationInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApplicationInfoWithOptions(request, runtime);
}

model GetAliyunXgipTokenResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetAliyunXgipTokenResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAliyunXgipTokenResponseBody(name='body'),
}

async function getAliyunXgipTokenWithOptions(runtime: Util.RuntimeOptions): GetAliyunXgipTokenResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetAliyunXgipToken',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAliyunXgipToken(): GetAliyunXgipTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAliyunXgipTokenWithOptions(runtime);
}

model GetApplicationRequest {
  aliUid?: long(name='AliUid'),
  appCode?: string(name='AppCode'),
  itemCode?: string(name='ItemCode'),
}

model GetApplicationResponseBody = {
  code?: string(name='Code'),
  data?: [  map[string]any ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetApplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetApplicationResponseBody(name='body'),
}

async function getApplicationWithOptions(request: GetApplicationRequest, runtime: Util.RuntimeOptions): GetApplicationResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetApplication',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getApplication(request: GetApplicationRequest): GetApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getApplicationWithOptions(request, runtime);
}

model GetFreeFlowInstanceRequest {
  aliuid?: long(name='Aliuid'),
  appId?: string(name='AppId'),
  instanceId?: string(name='InstanceId'),
  itemCode?: string(name='ItemCode'),
}

model GetFreeFlowInstanceResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      appCode?: string(name='AppCode'),
      appName?: string(name='AppName'),
      endTime?: string(name='EndTime'),
      instanceMemo?: string(name='InstanceMemo'),
      instanceStatus?: string(name='InstanceStatus'),
      openTime?: string(name='OpenTime'),
      specType?: string(name='SpecType'),
      startTime?: string(name='StartTime'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetFreeFlowInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFreeFlowInstanceResponseBody(name='body'),
}

async function getFreeFlowInstanceWithOptions(request: GetFreeFlowInstanceRequest, runtime: Util.RuntimeOptions): GetFreeFlowInstanceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFreeFlowInstance',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFreeFlowInstance(request: GetFreeFlowInstanceRequest): GetFreeFlowInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFreeFlowInstanceWithOptions(request, runtime);
}

model GetFreeFlowProductListRequest {
  aliUid?: long(name='AliUid'),
  instanceId?: string(name='InstanceId'),
}

model GetFreeFlowProductListResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      configured?: boolean(name='Configured'),
      flowProductAmount?: string(name='FlowProductAmount'),
      flowProductId?: string(name='FlowProductId'),
      flowProductName?: string(name='FlowProductName'),
      flowProductPeriod?: string(name='FlowProductPeriod'),
      flowType?: string(name='FlowType'),
      operator?: string(name='Operator'),
      specType?: string(name='SpecType'),
      spid?: string(name='Spid'),
      unitPrice?: int32(name='UnitPrice'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetFreeFlowProductListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFreeFlowProductListResponseBody(name='body'),
}

async function getFreeFlowProductListWithOptions(request: GetFreeFlowProductListRequest, runtime: Util.RuntimeOptions): GetFreeFlowProductListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFreeFlowProductList',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFreeFlowProductList(request: GetFreeFlowProductListRequest): GetFreeFlowProductListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFreeFlowProductListWithOptions(request, runtime);
}

model GetFreeFlowUsageRequest {
  aliUid?: long(name='AliUid'),
  curPageNum?: int32(name='CurPageNum'),
  instanceId?: string(name='InstanceId'),
  month?: string(name='Month'),
  numPerPage?: int32(name='NumPerPage'),
}

model GetFreeFlowUsageResponseBody = {
  code?: string(name='Code'),
  data?: {
    curPageNum?: int32(name='CurPageNum'),
    customerList?: [ 
      {
        channelId?: string(name='ChannelId'),
        customerEndTime?: string(name='CustomerEndTime'),
        customerFlowOrderId?: string(name='CustomerFlowOrderId'),
        customerFlowStatus?: string(name='CustomerFlowStatus'),
        customerOpenTime?: string(name='CustomerOpenTime'),
        customerStartTime?: string(name='CustomerStartTime'),
        flowProductId?: string(name='FlowProductId'),
        flowProductName?: string(name='FlowProductName'),
        isLasting?: boolean(name='IsLasting'),
        mobileNumber?: string(name='MobileNumber'),
        unitNum?: int32(name='UnitNum'),
        unitPrice?: int32(name='UnitPrice'),
      }
    ](name='CustomerList'),
    hasNext?: boolean(name='HasNext'),
    hasPrev?: boolean(name='HasPrev'),
    instanceId?: string(name='InstanceId'),
    numPerPage?: int32(name='NumPerPage'),
    totalNum?: int32(name='TotalNum'),
    totalPageNum?: int32(name='TotalPageNum'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetFreeFlowUsageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFreeFlowUsageResponseBody(name='body'),
}

async function getFreeFlowUsageWithOptions(request: GetFreeFlowUsageRequest, runtime: Util.RuntimeOptions): GetFreeFlowUsageResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFreeFlowUsage',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFreeFlowUsage(request: GetFreeFlowUsageRequest): GetFreeFlowUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFreeFlowUsageWithOptions(request, runtime);
}

model GetFreeFlowUsageStatisticRequest {
  aliUid?: long(name='AliUid'),
  appId?: string(name='AppId'),
  appName?: string(name='AppName'),
  instanceId?: string(name='InstanceId'),
  month?: long(name='Month'),
}

model GetFreeFlowUsageStatisticResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      instanceId?: string(name='InstanceId'),
      specType?: string(name='SpecType'),
      totalMoney?: string(name='TotalMoney'),
      totalOrderNumber?: long(name='TotalOrderNumber'),
      totalUnitNumber?: long(name='TotalUnitNumber'),
      yunOutProduct?: string(name='YunOutProduct'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetFreeFlowUsageStatisticResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFreeFlowUsageStatisticResponseBody(name='body'),
}

async function getFreeFlowUsageStatisticWithOptions(request: GetFreeFlowUsageStatisticRequest, runtime: Util.RuntimeOptions): GetFreeFlowUsageStatisticResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFreeFlowUsageStatistic',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFreeFlowUsageStatistic(request: GetFreeFlowUsageStatisticRequest): GetFreeFlowUsageStatisticResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFreeFlowUsageStatisticWithOptions(request, runtime);
}

model GetInventoryInfoRequest {
  instanceId?: string(name='InstanceId'),
  itemCode?: string(name='ItemCode'),
  mobile?: string(name='Mobile'),
  UId?: long(name='UId'),
}

model GetInventoryInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    inventory?: long(name='Inventory'),
    residualInventory?: long(name='ResidualInventory'),
    usedStock?: long(name='UsedStock'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetInventoryInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInventoryInfoResponseBody(name='body'),
}

async function getInventoryInfoWithOptions(request: GetInventoryInfoRequest, runtime: Util.RuntimeOptions): GetInventoryInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInventoryInfo',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInventoryInfo(request: GetInventoryInfoRequest): GetInventoryInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInventoryInfoWithOptions(request, runtime);
}

model GetItemListRequest {
  aliUid?: long(name='AliUid'),
  bizCode?: string(name='BizCode'),
}

model GetItemListResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bizCode?: string(name='BizCode'),
      bizType?: string(name='BizType'),
      itemBuyUrl?: string(name='ItemBuyUrl'),
      itemCode?: string(name='ItemCode'),
      itemName?: string(name='ItemName'),
      name?: string(name='Name'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetItemListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetItemListResponseBody(name='body'),
}

async function getItemListWithOptions(request: GetItemListRequest, runtime: Util.RuntimeOptions): GetItemListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetItemList',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getItemList(request: GetItemListRequest): GetItemListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getItemListWithOptions(request, runtime);
}

model GetOrderFreeFlowProductStatusRequest {
  aliUid?: long(name='AliUid'),
  customerFlowOrderId?: string(name='CustomerFlowOrderId'),
}

model GetOrderFreeFlowProductStatusResponseBody = {
  code?: string(name='Code'),
  data?: {
    customerFlowOrderId?: string(name='CustomerFlowOrderId'),
    customerFlowRequestId?: string(name='CustomerFlowRequestId'),
    error?: string(name='Error'),
    status?: string(name='Status'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetOrderFreeFlowProductStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetOrderFreeFlowProductStatusResponseBody(name='body'),
}

async function getOrderFreeFlowProductStatusWithOptions(request: GetOrderFreeFlowProductStatusRequest, runtime: Util.RuntimeOptions): GetOrderFreeFlowProductStatusResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOrderFreeFlowProductStatus',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOrderFreeFlowProductStatus(request: GetOrderFreeFlowProductStatusRequest): GetOrderFreeFlowProductStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOrderFreeFlowProductStatusWithOptions(request, runtime);
}

model GetOrderItemListResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetOrderItemListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetOrderItemListResponseBody(name='body'),
}

async function getOrderItemListWithOptions(runtime: Util.RuntimeOptions): GetOrderItemListResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetOrderItemList',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOrderItemList(): GetOrderItemListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOrderItemListWithOptions(runtime);
}

model GetQosFlowUsageRequest {
  aliUid?: long(name='AliUid'),
  curPageNum?: int32(name='CurPageNum'),
  endTime?: string(name='EndTime'),
  instanceId?: string(name='InstanceId'),
  month?: long(name='Month'),
  numPerPage?: int32(name='NumPerPage'),
  startTime?: string(name='StartTime'),
  type?: boolean(name='Type'),
}

model GetQosFlowUsageResponseBody = {
  code?: string(name='Code'),
  data?: {
    curPageNum?: int32(name='CurPageNum'),
    customerList?: [ 
      {
        aliUid?: long(name='AliUid'),
        appId?: string(name='AppId'),
        dsDay?: long(name='DsDay'),
        dsMonth?: long(name='DsMonth'),
        endTime?: string(name='EndTime'),
        instanceId?: string(name='InstanceId'),
        itemCode?: string(name='ItemCode'),
        message?: string(name='Message'),
        name?: string(name='Name'),
        operator?: string(name='Operator'),
        orderNum?: int32(name='OrderNum'),
        productId?: string(name='ProductId'),
        productName?: string(name='ProductName'),
        provice?: string(name='Provice'),
        qosRequestId?: string(name='QosRequestId'),
        remark?: string(name='Remark'),
        specType?: string(name='SpecType'),
        startTime?: string(name='StartTime'),
        status?: string(name='Status'),
        totalPrice?: int32(name='TotalPrice'),
        totolTime?: long(name='TotolTime'),
      }
    ](name='CustomerList'),
    hasNext?: boolean(name='HasNext'),
    hasPrev?: boolean(name='HasPrev'),
    instanceId?: string(name='InstanceId'),
    numPerPage?: int32(name='NumPerPage'),
    totalNum?: int32(name='TotalNum'),
    totalPageNum?: int32(name='TotalPageNum'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetQosFlowUsageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetQosFlowUsageResponseBody(name='body'),
}

async function getQosFlowUsageWithOptions(request: GetQosFlowUsageRequest, runtime: Util.RuntimeOptions): GetQosFlowUsageResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQosFlowUsage',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getQosFlowUsage(request: GetQosFlowUsageRequest): GetQosFlowUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQosFlowUsageWithOptions(request, runtime);
}

model GetQosUsageStatisticRequest {
  aliUid?: long(name='AliUid'),
  curPageNum?: int32(name='CurPageNum'),
  endTime?: string(name='EndTime'),
  instanceId?: string(name='InstanceId'),
  month?: long(name='Month'),
  numPerPage?: int32(name='NumPerPage'),
  requestId?: string(name='RequestId'),
  startTime?: string(name='StartTime'),
}

model GetQosUsageStatisticResponseBody = {
  code?: string(name='Code'),
  data?: {
    curPageNum?: int32(name='CurPageNum'),
    getQosUsageStatisticResList?: [ 
      {
        billCount?: long(name='BillCount'),
        dsDay?: long(name='DsDay'),
        failCount?: long(name='FailCount'),
        instanceId?: string(name='InstanceId'),
        month?: long(name='Month'),
        operator?: string(name='Operator'),
        productName?: string(name='ProductName'),
        provice?: string(name='Provice'),
        specType?: string(name='SpecType'),
        sucessCount?: long(name='SucessCount'),
        totalCount?: long(name='TotalCount'),
        yunOutProduct?: string(name='YunOutProduct'),
      }
    ](name='GetQosUsageStatisticResList'),
    numPerPage?: int32(name='NumPerPage'),
    totalNum?: int32(name='TotalNum'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetQosUsageStatisticResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetQosUsageStatisticResponseBody(name='body'),
}

async function getQosUsageStatisticWithOptions(request: GetQosUsageStatisticRequest, runtime: Util.RuntimeOptions): GetQosUsageStatisticResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQosUsageStatistic',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getQosUsageStatistic(request: GetQosUsageStatisticRequest): GetQosUsageStatisticResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQosUsageStatisticWithOptions(request, runtime);
}

model GetUatDataListRequest {
  aliUid?: long(name='AliUid'),
  dsMonth?: long(name='DsMonth'),
  itemId?: string(name='ItemId'),
}

model GetUatDataListResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      dsList?: [ 
        {
          dsData?: long(name='DsData'),
          dsDay?: long(name='DsDay'),
        }
      ](name='DsList'),
      specType?: string(name='SpecType'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetUatDataListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUatDataListResponseBody(name='body'),
}

async function getUatDataListWithOptions(request: GetUatDataListRequest, runtime: Util.RuntimeOptions): GetUatDataListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUatDataList',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUatDataList(request: GetUatDataListRequest): GetUatDataListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUatDataListWithOptions(request, runtime);
}

model GetUatSpecCtDataRequest {
  aliUid?: long(name='AliUid'),
  dsMonth?: long(name='DsMonth'),
  itemId?: string(name='ItemId'),
}

model GetUatSpecCtDataResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      monthCount?: long(name='MonthCount'),
      specType?: string(name='SpecType'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model GetUatSpecCtDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUatSpecCtDataResponseBody(name='body'),
}

async function getUatSpecCtDataWithOptions(request: GetUatSpecCtDataRequest, runtime: Util.RuntimeOptions): GetUatSpecCtDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUatSpecCtData',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUatSpecCtData(request: GetUatSpecCtDataRequest): GetUatSpecCtDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUatSpecCtDataWithOptions(request, runtime);
}

model MockGetOrderFreeFlowProductStatusRequest {
  aliUid?: long(name='AliUid'),
  customerFlowOrderId?: string(name='CustomerFlowOrderId'),
}

model MockGetOrderFreeFlowProductStatusResponseBody = {
  code?: string(name='Code'),
  data?: {
    customerFlowOrderId?: string(name='CustomerFlowOrderId'),
    customerFlowRequestId?: string(name='CustomerFlowRequestId'),
    error?: string(name='Error'),
    status?: string(name='Status'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model MockGetOrderFreeFlowProductStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MockGetOrderFreeFlowProductStatusResponseBody(name='body'),
}

async function mockGetOrderFreeFlowProductStatusWithOptions(request: MockGetOrderFreeFlowProductStatusRequest, runtime: Util.RuntimeOptions): MockGetOrderFreeFlowProductStatusResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MockGetOrderFreeFlowProductStatus',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function mockGetOrderFreeFlowProductStatus(request: MockGetOrderFreeFlowProductStatusRequest): MockGetOrderFreeFlowProductStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return mockGetOrderFreeFlowProductStatusWithOptions(request, runtime);
}

model MockOrderFreeFlowProductRequest {
  aliUid?: long(name='AliUid'),
  channelId?: string(name='ChannelId'),
  customerFlowRequestId?: string(name='CustomerFlowRequestId'),
  flowProductId?: string(name='FlowProductId'),
  instanceId?: string(name='InstanceId'),
  lasting?: string(name='Lasting'),
  mobileNumber?: string(name='MobileNumber'),
  notifyUrl?: string(name='NotifyUrl'),
  operator?: string(name='Operator'),
  purchaseOrderId?: string(name='PurchaseOrderId'),
}

model MockOrderFreeFlowProductResponseBody = {
  code?: string(name='Code'),
  data?: {
    bizCode?: string(name='BizCode'),
    customerFlowOrderId?: string(name='CustomerFlowOrderId'),
    customerFlowRequestId?: string(name='CustomerFlowRequestId'),
    status?: string(name='Status'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model MockOrderFreeFlowProductResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MockOrderFreeFlowProductResponseBody(name='body'),
}

async function mockOrderFreeFlowProductWithOptions(request: MockOrderFreeFlowProductRequest, runtime: Util.RuntimeOptions): MockOrderFreeFlowProductResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.customerFlowRequestId)) {
    query['CustomerFlowRequestId'] = request.customerFlowRequestId;
  }
  if (!Util.isUnset(request.flowProductId)) {
    query['FlowProductId'] = request.flowProductId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.lasting)) {
    query['Lasting'] = request.lasting;
  }
  if (!Util.isUnset(request.mobileNumber)) {
    query['MobileNumber'] = request.mobileNumber;
  }
  if (!Util.isUnset(request.notifyUrl)) {
    query['NotifyUrl'] = request.notifyUrl;
  }
  if (!Util.isUnset(request.operator)) {
    query['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.purchaseOrderId)) {
    query['PurchaseOrderId'] = request.purchaseOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MockOrderFreeFlowProduct',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function mockOrderFreeFlowProduct(request: MockOrderFreeFlowProductRequest): MockOrderFreeFlowProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return mockOrderFreeFlowProductWithOptions(request, runtime);
}

model ModifyApplicationRequest {
  aliUid?: long(name='AliUid'),
  appCode?: string(name='AppCode'),
  appName?: string(name='AppName'),
  appTypeList?: [ string ](name='AppTypeList'),
  appingList?: [ 
    {
      extId?: long(name='ExtId'),
      flowIp?: [ string ](name='FlowIp'),
      flowUrl?: [ string ](name='FlowUrl'),
      originalIpList?: [ string ](name='OriginalIpList'),
      originalUrlList?: [ string ](name='OriginalUrlList'),
    }
  ](name='AppingList'),
}

model ModifyApplicationResponseBody = {
  appId?: string(name='AppId'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyApplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyApplicationResponseBody(name='body'),
}

async function modifyApplicationWithOptions(request: ModifyApplicationRequest, runtime: Util.RuntimeOptions): ModifyApplicationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aliUid)) {
    body['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appCode)) {
    body['AppCode'] = request.appCode;
  }
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appTypeList)) {
    body['AppTypeList'] = request.appTypeList;
  }
  if (!Util.isUnset(request.appingList)) {
    body['AppingList'] = request.appingList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApplication',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyApplication(request: ModifyApplicationRequest): ModifyApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyApplicationWithOptions(request, runtime);
}

model OrderFreeFlowProductRequest {
  aliUid?: long(name='AliUid'),
  channelId?: string(name='ChannelId'),
  customerFlowRequestId?: string(name='CustomerFlowRequestId'),
  flowProductId?: string(name='FlowProductId'),
  instanceId?: string(name='InstanceId'),
  lasting?: string(name='Lasting'),
  mobileNumber?: string(name='MobileNumber'),
  notifyUrl?: string(name='NotifyUrl'),
  operator?: string(name='Operator'),
  purchaseOrderId?: string(name='PurchaseOrderId'),
}

model OrderFreeFlowProductResponseBody = {
  code?: string(name='Code'),
  data?: {
    bizCode?: string(name='BizCode'),
    customerFlowOrderId?: string(name='CustomerFlowOrderId'),
    customerFlowRequestId?: string(name='CustomerFlowRequestId'),
    status?: string(name='Status'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model OrderFreeFlowProductResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: OrderFreeFlowProductResponseBody(name='body'),
}

async function orderFreeFlowProductWithOptions(request: OrderFreeFlowProductRequest, runtime: Util.RuntimeOptions): OrderFreeFlowProductResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.customerFlowRequestId)) {
    query['CustomerFlowRequestId'] = request.customerFlowRequestId;
  }
  if (!Util.isUnset(request.flowProductId)) {
    query['FlowProductId'] = request.flowProductId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.lasting)) {
    query['Lasting'] = request.lasting;
  }
  if (!Util.isUnset(request.mobileNumber)) {
    query['MobileNumber'] = request.mobileNumber;
  }
  if (!Util.isUnset(request.notifyUrl)) {
    query['NotifyUrl'] = request.notifyUrl;
  }
  if (!Util.isUnset(request.operator)) {
    query['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.purchaseOrderId)) {
    query['PurchaseOrderId'] = request.purchaseOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OrderFreeFlowProduct',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function orderFreeFlowProduct(request: OrderFreeFlowProductRequest): OrderFreeFlowProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return orderFreeFlowProductWithOptions(request, runtime);
}

model OrderQosProductRequest {
  aliUid?: long(name='AliUid'),
  channelId?: string(name='ChannelId'),
  IPv6?: string(name='IPv6'),
  instanceId?: string(name='InstanceId'),
  ipType?: string(name='IpType'),
  mobileNumber?: string(name='MobileNumber'),
  operator?: string(name='Operator'),
  privateIpv4?: string(name='PrivateIpv4'),
  productId?: string(name='ProductId'),
  provice?: string(name='Provice'),
  publicIpv4?: string(name='PublicIpv4'),
  qosRequestId?: string(name='QosRequestId'),
  targetIpList?: [ string ](name='TargetIpList'),
  token?: string(name='Token'),
  unitNum?: int32(name='UnitNum'),
}

model OrderQosProductResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model OrderQosProductResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: OrderQosProductResponseBody(name='body'),
}

async function orderQosProductWithOptions(request: OrderQosProductRequest, runtime: Util.RuntimeOptions): OrderQosProductResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.provice)) {
    query['Provice'] = request.provice;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.aliUid)) {
    body['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.channelId)) {
    body['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.IPv6)) {
    body['IPv6'] = request.IPv6;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ipType)) {
    body['IpType'] = request.ipType;
  }
  if (!Util.isUnset(request.mobileNumber)) {
    body['MobileNumber'] = request.mobileNumber;
  }
  if (!Util.isUnset(request.operator)) {
    body['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.privateIpv4)) {
    body['PrivateIpv4'] = request.privateIpv4;
  }
  if (!Util.isUnset(request.productId)) {
    body['ProductId'] = request.productId;
  }
  if (!Util.isUnset(request.publicIpv4)) {
    body['PublicIpv4'] = request.publicIpv4;
  }
  if (!Util.isUnset(request.qosRequestId)) {
    body['QosRequestId'] = request.qosRequestId;
  }
  if (!Util.isUnset(request.targetIpList)) {
    body['TargetIpList'] = request.targetIpList;
  }
  if (!Util.isUnset(request.token)) {
    body['Token'] = request.token;
  }
  if (!Util.isUnset(request.unitNum)) {
    body['UnitNum'] = request.unitNum;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OrderQosProduct',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function orderQosProduct(request: OrderQosProductRequest): OrderQosProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return orderQosProductWithOptions(request, runtime);
}

model SaveApplicationInfoRequest {
  aliUid?: long(name='AliUid'),
  appId?: string(name='AppId'),
  appName?: string(name='AppName'),
  appTypeList?: string(name='AppTypeList'),
  appingList?: string(name='AppingList'),
  itemCode?: string(name='ItemCode'),
}

model SaveApplicationInfoResponseBody = {
  appId?: string(name='AppId'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SaveApplicationInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SaveApplicationInfoResponseBody(name='body'),
}

async function saveApplicationInfoWithOptions(request: SaveApplicationInfoRequest, runtime: Util.RuntimeOptions): SaveApplicationInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aliUid)) {
    body['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appTypeList)) {
    body['AppTypeList'] = request.appTypeList;
  }
  if (!Util.isUnset(request.appingList)) {
    body['AppingList'] = request.appingList;
  }
  if (!Util.isUnset(request.itemCode)) {
    body['ItemCode'] = request.itemCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SaveApplicationInfo',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveApplicationInfo(request: SaveApplicationInfoRequest): SaveApplicationInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveApplicationInfoWithOptions(request, runtime);
}

model SdkChargeFlowRequest {
  channelCode?: string(name='ChannelCode'),
  instanceId?: string(name='InstanceId'),
  itemCode?: string(name='ItemCode'),
  mobile?: string(name='Mobile'),
  orderTime?: string(name='OrderTime'),
  outBizNo?: string(name='OutBizNo'),
  UId?: long(name='UId'),
}

model SdkChargeFlowResponseBody = {
  code?: string(name='Code'),
  data?: {
    bizCode?: string(name='BizCode'),
    customerFlowOrderId?: string(name='CustomerFlowOrderId'),
    customerFlowRequestId?: string(name='CustomerFlowRequestId'),
    status?: string(name='Status'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model SdkChargeFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SdkChargeFlowResponseBody(name='body'),
}

async function sdkChargeFlowWithOptions(request: SdkChargeFlowRequest, runtime: Util.RuntimeOptions): SdkChargeFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.channelCode)) {
    query['ChannelCode'] = request.channelCode;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.itemCode)) {
    query['ItemCode'] = request.itemCode;
  }
  if (!Util.isUnset(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!Util.isUnset(request.orderTime)) {
    query['OrderTime'] = request.orderTime;
  }
  if (!Util.isUnset(request.outBizNo)) {
    query['OutBizNo'] = request.outBizNo;
  }
  if (!Util.isUnset(request.UId)) {
    query['UId'] = request.UId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SdkChargeFlow',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sdkChargeFlow(request: SdkChargeFlowRequest): SdkChargeFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return sdkChargeFlowWithOptions(request, runtime);
}

model SdkGetInventoryInfoRequest {
  channelCode?: string(name='ChannelCode'),
  instanceId?: string(name='InstanceId'),
  itemCode?: string(name='ItemCode'),
  mobile?: string(name='Mobile'),
  outBizNo?: string(name='OutBizNo'),
  UId?: long(name='UId'),
}

model SdkGetInventoryInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    inventory?: long(name='Inventory'),
    residualInventory?: long(name='ResidualInventory'),
    usedStock?: long(name='UsedStock'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model SdkGetInventoryInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SdkGetInventoryInfoResponseBody(name='body'),
}

async function sdkGetInventoryInfoWithOptions(request: SdkGetInventoryInfoRequest, runtime: Util.RuntimeOptions): SdkGetInventoryInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SdkGetInventoryInfo',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sdkGetInventoryInfo(request: SdkGetInventoryInfoRequest): SdkGetInventoryInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return sdkGetInventoryInfoWithOptions(request, runtime);
}

model SdkGetItemInstListRequest {
  channelCode?: string(name='ChannelCode'),
  current?: int32(name='Current'),
  instanceId?: string(name='InstanceId'),
  itemCode?: string(name='ItemCode'),
  mobile?: string(name='Mobile'),
  outBizNo?: string(name='OutBizNo'),
  pageSize?: int32(name='PageSize'),
  status?: string(name='Status'),
  UId?: long(name='UId'),
}

model SdkGetItemInstListResponseBody = {
  code?: string(name='Code'),
  data?: {
    list?: [ 
      {
        createTime?: string(name='CreateTime'),
        expireTime?: string(name='ExpireTime'),
        instanceId?: string(name='InstanceId'),
        productId?: string(name='ProductId'),
        productName?: string(name='ProductName'),
        status?: int32(name='Status'),
      }
    ](name='List'),
    pageInfo?: {
      current?: int32(name='Current'),
      pageSize?: int32(name='PageSize'),
      total?: long(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model SdkGetItemInstListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SdkGetItemInstListResponseBody(name='body'),
}

async function sdkGetItemInstListWithOptions(request: SdkGetItemInstListRequest, runtime: Util.RuntimeOptions): SdkGetItemInstListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SdkGetItemInstList',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sdkGetItemInstList(request: SdkGetItemInstListRequest): SdkGetItemInstListResponse {
  var runtime = new Util.RuntimeOptions{};
  return sdkGetItemInstListWithOptions(request, runtime);
}

model SdkOrderQosProductRequest {
  aliUid?: long(name='AliUid'),
  channelId?: string(name='ChannelId'),
  ctToken?: string(name='CtToken'),
  IPv6?: string(name='IPv6'),
  instanceId?: string(name='InstanceId'),
  ipType?: string(name='IpType'),
  mobileNumber?: string(name='MobileNumber'),
  operator?: string(name='Operator'),
  privateIpv4?: string(name='PrivateIpv4'),
  productId?: string(name='ProductId'),
  provice?: string(name='Provice'),
  publicIpv4?: string(name='PublicIpv4'),
  qosRequestId?: string(name='QosRequestId'),
  targetIpList?: [ string ](name='TargetIpList'),
  token?: string(name='Token'),
  unitNum?: int32(name='UnitNum'),
}

model SdkOrderQosProductResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model SdkOrderQosProductResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SdkOrderQosProductResponseBody(name='body'),
}

async function sdkOrderQosProductWithOptions(request: SdkOrderQosProductRequest, runtime: Util.RuntimeOptions): SdkOrderQosProductResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.channelId)) {
    query['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.ctToken)) {
    query['CtToken'] = request.ctToken;
  }
  if (!Util.isUnset(request.IPv6)) {
    query['IPv6'] = request.IPv6;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ipType)) {
    query['IpType'] = request.ipType;
  }
  if (!Util.isUnset(request.mobileNumber)) {
    query['MobileNumber'] = request.mobileNumber;
  }
  if (!Util.isUnset(request.operator)) {
    query['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.privateIpv4)) {
    query['PrivateIpv4'] = request.privateIpv4;
  }
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  if (!Util.isUnset(request.provice)) {
    query['Provice'] = request.provice;
  }
  if (!Util.isUnset(request.publicIpv4)) {
    query['PublicIpv4'] = request.publicIpv4;
  }
  if (!Util.isUnset(request.qosRequestId)) {
    query['QosRequestId'] = request.qosRequestId;
  }
  if (!Util.isUnset(request.targetIpList)) {
    query['TargetIpList'] = request.targetIpList;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.unitNum)) {
    query['UnitNum'] = request.unitNum;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SdkOrderQosProduct',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'Anonymous',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sdkOrderQosProduct(request: SdkOrderQosProductRequest): SdkOrderQosProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return sdkOrderQosProductWithOptions(request, runtime);
}

model SdkValidateStatusRequest {
  appId?: string(name='AppId'),
  credentialType?: string(name='CredentialType'),
  credentialValue?: string(name='CredentialValue'),
  operator?: string(name='Operator'),
  token?: string(name='Token'),
}

model SdkValidateStatusResponseBody = {
  code?: string(name='Code'),
  data?: {
    appExtPopList?: [ 
      {
        extId?: long(name='ExtId'),
        flowIp?: [ string ](name='FlowIp'),
        flowUrl?: [ string ](name='FlowUrl'),
        originalIpList?: [ string ](name='OriginalIpList'),
        originalUrlList?: [ string ](name='OriginalUrlList'),
      }
    ](name='AppExtPopList'),
    freeFlow?: boolean(name='FreeFlow'),
    pseudoCode?: string(name='PseudoCode'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model SdkValidateStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SdkValidateStatusResponseBody(name='body'),
}

async function sdkValidateStatusWithOptions(request: SdkValidateStatusRequest, runtime: Util.RuntimeOptions): SdkValidateStatusResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SdkValidateStatus',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'Anonymous',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sdkValidateStatus(request: SdkValidateStatusRequest): SdkValidateStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return sdkValidateStatusWithOptions(request, runtime);
}

model ValidControllerAuthorRequest {
  aliUid?: long(name='AliUid'),
  itemCode?: string(name='ItemCode'),
}

model ValidControllerAuthorResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model ValidControllerAuthorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ValidControllerAuthorResponseBody(name='body'),
}

async function validControllerAuthorWithOptions(request: ValidControllerAuthorRequest, runtime: Util.RuntimeOptions): ValidControllerAuthorResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ValidControllerAuthor',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function validControllerAuthor(request: ValidControllerAuthorRequest): ValidControllerAuthorResponse {
  var runtime = new Util.RuntimeOptions{};
  return validControllerAuthorWithOptions(request, runtime);
}

model ValidFlowRequest {
  instanceId?: string(name='InstanceId'),
  itemCode?: string(name='ItemCode'),
  mobile?: string(name='Mobile'),
  UId?: long(name='UId'),
}

model ValidFlowResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model ValidFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ValidFlowResponseBody(name='body'),
}

async function validFlowWithOptions(request: ValidFlowRequest, runtime: Util.RuntimeOptions): ValidFlowResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ValidFlow',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function validFlow(request: ValidFlowRequest): ValidFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return validFlowWithOptions(request, runtime);
}

model ValidateStatusRequest {
  aliUid?: long(name='AliUid'),
  appId?: string(name='AppId'),
  credentialType?: string(name='CredentialType'),
  credentialValue?: string(name='CredentialValue'),
  operator?: string(name='Operator'),
}

model ValidateStatusResponseBody = {
  code?: string(name='Code'),
  data?: {
    appExtPopList?: [ 
      {
        extId?: long(name='ExtId'),
        flowIp?: [ string ](name='FlowIp'),
        flowUrl?: [ string ](name='FlowUrl'),
        originalIpList?: [ string ](name='OriginalIpList'),
        originalUrlList?: [ string ](name='OriginalUrlList'),
      }
    ](name='AppExtPopList'),
    freeFlow?: boolean(name='FreeFlow'),
    pseudoCode?: string(name='PseudoCode'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  rt?: long(name='Rt'),
  success?: boolean(name='Success'),
}

model ValidateStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ValidateStatusResponseBody(name='body'),
}

async function validateStatusWithOptions(request: ValidateStatusRequest, runtime: Util.RuntimeOptions): ValidateStatusResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ValidateStatus',
    version = '2022-05-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function validateStatus(request: ValidateStatusRequest): ValidateStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return validateStatusWithOptions(request, runtime);
}

